Skip to contentSkip to conversation

gstreamer vaapih264enc segfault

Bug 102006 [email protected] 1 participant 4 messages Aug 1, 2017 – Aug 14, 2017

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=102006

Bug ID: 102006
Summary: gstreamer vaapih264enc segfault
Product: DRI
Version: XOrg git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: DRM/Radeon
Assignee: [email protected]
Reporter: [email protected]

Created attachment 133180
--> https://bugs.freedesktop.org/attachment.cgi?id=133180&action=edit
proposed patch by Julien Isorce

Based on following bug:

https://bugzilla.gnome.org/show_bug.cgi?id=785085

In Mesa the picture_id is a frame number which is in the range 0-31 here:

https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/state_trackers/va/picture.c#n430

In gst vaapi it is used as surface handles and that can be larger than 31 thus causing SEGFAULT.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author Tested-by Tomas Rataj Acked-by Christian König
#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=102006

--- Comment #2 from Julien Isorce <[email protected]> --- Comment on attachment 133180
--> https://bugs.freedesktop.org/attachment.cgi?id=133180
proposed patch by Julien Isorce

commit 91d93aa62162f98d6377e5c796b63faa263f2c18

Author: Julien Isorce <[email protected]>
Date:   Tue Jul 25 15:31:28 2017 +0100

st/va: change frame_idx from array to hash table

The picture_id was assumed to be a frame number so in 0-31. But the vaapi client gstreamer-vaapi uses the surfaces handles as identifier which are unsigned int.

This bug can happen when using a lot of vaapi surfaces within the same process. Indeed Mesa/st/va increments a counter for the surface ID: mesa/util/u_handle_table.c::handle_table_add which starts from 0 and incremented by 1 at each call.
So creating more than 32 surfaces was a problem.

The following bug contains a test that reproduces the problem by running a couple of vaapih264enc in the same process. The above also explains why there was no pb when running them in separated processes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102006

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=102006

Julien Isorce <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel